﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using RoboTrocity;

namespace RoboTrocity {
	class BinarySwitch : Switch {

		bool isActivated;

		/// <summary>
		/// Makes a switch, given a position and a two-frame animation
		/// </summary>
		/// <param name="_position">The position of the Switch.</param>
		/// <param name="imgLoc">The two-frame asset name.</param>
		public BinarySwitch(Point _position, string imgLoc) :
			base(_position) {
			isActivated = false; 
		}

		public override void flipSwitch(){
			isActivated = !isActivated;
			DispSprite.Frame = 0;
			if (!isActivated) {
				DispSprite.Frame = 1;
			}
			AttachedTrigger.fireTrigger();
		}

		public override void collideWith(GameObject gameObject) {

		}

		public override void Update(float gameTime) {}

		public bool IsActivated{
			get { return isActivated; }
			set { isActivated = value; }
		}
	}
}
